package NC;

public class NC74 {
    public int GetNumberOfK(int [] array , int k) {
        return bisearch(array,k+0.5)-bisearch(array,k-0.5);
    }
    public int bisearch(int[] array,double k){
        int left =0,right =array.length-1;
        int mid;
        while (left<=right){
            mid = left+(right-left)/2;
            if(array[mid]<k) left = mid+1;
            if(array[mid]>k) right = mid -1;
        }
        return left;
    }
}